home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-13 | 1.7 KB | 50 lines | [TEXT/ttxt] |
- language: infix-dylan
- module: Online-Insultant
-
- // This class allows putting up new insults
- define class <insulting-behavior> (<behavior>)
- end class;
-
- define method behavior-setup-menus (behavior :: <insulting-behavior>,
- next :: <list>,
- main-handler :: <main-handler>)
- => ();
- next-method();
-
- enable-item(#"new");
- end method;
-
- define method behavior-event (behavior :: <insulting-behavior>,
- next :: <list>,
- main-handler :: <main-handler>,
- event :: <menu-event>,
- id == #"new")
- => ();
- ignore(behavior, next, main-handler, event, id);
- open(make-insult-window());
- end method;
-
- define constant init-Online-Insultant-menus = method()
- make(<menu>,
- title: "File",
- install: #t,
- items: list( make(<menu-item>,
- title: "New Insult",
- identifier: #"new",
- command-key: 'N'),
- make(<menu-item>,
- title: "Close",
- identifier: #"close",
- command-key: 'W'),
- make(<menu-item>,
- title: "Quit",
- identifier: #"quit",
- command-key: 'Q')));
-
- install-menu(make-edit-menu());
-
- /*--- to do: About box, Windows menu, English/French menu ---*/
-
- /* Activate the New Insult command */
- add-behavior(*main-handler*, make(<insulting-behavior>));
- end method;